<template>
    <div class="grid-content rt">
        <ul>
            <li v-for="item in collect" :key="item.id" @click="handActive(item.id)" :class="numA===item.id?'active':''">{{item.name}}</li>
        </ul>
    </div>
    <div class="grid-content rb" >
      <span>
        <el-input
          v-model="input1"
          size="large"
          placeholder="请输入"
          :prefix-icon="Search"
        />
      </span>
      <el-button v-if="showDel" @click="handShow" type="danger">批量删除</el-button>
      <span v-else>
        <el-button  @click="showDel=true">取消</el-button>
        <el-button >确定</el-button>
        <el-button >全选</el-button>
      </span>
    </div>
  </template>
  
  <script setup lang='ts'>
    import {ref} from 'vue'
    import {Search} from '@element-plus/icons-vue'
    const input1 = ref('')
    const showDel=ref(true)
    const handShow=()=>{
      showDel.value=false
    }
    interface colValue{
        name:string,
        id:number
    }
    type colListValue=colValue[]
    const collect=ref<colListValue>([
        {
            name:'资源',
            id:1001
        },{
            name:'视频课',
            id:1002
        },{
            name:'线下课',
            id:1003
        },{
            name:'直播',
            id:1004
        }
    ])
    const numA=ref(1001)
    const handActive=(val:number)=>{
        numA.value = val
    }
  </script>
  
  <style scoped lang="less">
    .grid-content {
    border-radius: 10px;
    background-color:white ;
    margin: 20px 5px;
    padding-left:1px;
  }
  .rb{
    min-height:500px;
    padding: 20px;
    display:flex;
    justify-content: space-between;
  }
  .rt{
    min-height: 60px;
    line-height: 60px;
    padding-left: 30px;
    li{
        display: inline-block;
        margin-right: 25px;
        cursor: pointer;
    }
    .active{
            border-bottom: 3px solid #f93684;
    }
    li:hover{
        border-bottom: 3px solid #f93684;
    }
  }
  .el-input{
    width: 300px;
  }
  </style>